/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.colegiatura.bc;

import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.cip.esymons.colegiatura.be.Deporte;

/**
 *
 * @author ADMINISTRADOR
 */
public class DeporteDelegate {

    private DeporteFacadeLocal local;


    public DeporteDelegate() {

      local = lookupDeporteFacade();
    }

    public void create(Deporte deporte){

        local.create(deporte);
    }

    public void edit(Deporte deporte){

        local.edit(deporte);
    }

    public void remove(Deporte deporte){

        local.remove(deporte);
    }

    public Deporte find(Object id){

        return local.find(id);
    }

    public List<Deporte> findAll(){

        return local.findAll();
    }

    private DeporteFacadeLocal lookupDeporteFacade() {
        try {
            Context c = new InitialContext();
            return (DeporteFacadeLocal) c.lookup("java:comp/env/DeporteFacade");
        } catch (NamingException ne) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        }
    }

    

   



}
